<?php
	header ("content-type: text/xml");
	$dom = new DOMDocument('1.0', 'UTF-8');
	$root = $dom->appendChild(new DOMElement('root'));
	$conf = $root->appendChild(new DOMElement('conf'));
	$conf->appendChild(new DOMElement('imageExt','.jpg'));
	$conf->appendChild(new DOMElement('preTn',''));
	$conf->appendChild(new DOMElement('postTn','s'));
	$conf->appendChild(new DOMElement('textExt','.txt'));
		
	$arr=array();
	$arr8=array();
	$d = dir("./");
	for(;$arr[]=$d->read();){}
	sort($arr);
	$length=count($arr);

	for(;$length--;)
	{
		$entry = array_pop($arr);
		if((substr($entry,-4))!='.jpg')	continue;
		if((substr($entry,0,1))=='8')
		{
			array_push($arr8,$entry);
			continue; 
		}
		else
		{
			array_push($arr1,$entry);
			break;
		}
	}
	for(;$entry = array_pop($arr8);)
	{
		$entry=	substr($entry,0,-4);
		substr($entry,-1,1)=='s'?null:$root->appendChild(new DOMElement('img',$entry));
	}
	for(;$entry = array_pop($arr);)
	{
		if((substr($entry,-4))!='.jpg')	CONTINUE;
		$entry=	substr($entry,0,-4);
		substr($entry,-1,1)=='s'?null:$root->appendChild(new DOMElement('img',$entry));
	}

//	header ("content-type: text/xml");
	echo $dom->saveXML();
?>